import request from '../utils/request'
// 获取用户列表
export const getUsers = (obj) => request({
    method: 'get',
    url: '/users',
    params: obj
})
// 设置用户状态
export const setState = (id, state) => request({
    method: 'PUT',
    url: `/users/${id}/state/${state}`,
})
// 添加用户
export const addUsers = (data) => request({
    method: 'POST',
    url: `/users`,
    data
})
// 编辑用户
export const editUserInfo = (data) => request({
    method: 'PUT',
    url: `/users/${data.id - 0}`,
    data
})
// 删除用户
export const deleteUser = (id) => request({
    method: 'DELETE',
    url: `/users/${id}`,
})
// 改变角色
export const changRole = (id, roleId) => request({
    method: 'PUT',
    url: `users/${id}/role`,
    data: {
        rid: roleId
    }
})